package 算法;

/**
 * @author 乐心湖
 * @date 2020/6/16 12:59
 **/
public class ReverseInteger {
    public int reverse(int x) {
        long result = 0;
        while (x != 0) {
            result = result * 10 + x % 10;
            x /= 10;
        }
        return (int) result != result ? 0 : (int) result;
    }
}
